package com.mxf.agricultural.service;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mxf.agricultural.model.dto.commodity.CommodityQueryRequest;
import com.mxf.agricultural.model.entity.Commodity;
import com.mxf.agricultural.model.vo.CommodityVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author JD
* @description 针对表【commodity(商品)】的数据库操作Service
* @createDate 2024-02-11 19:11:26
*/
public interface CommodityService extends IService<Commodity> {
    /**
     * 校验
     *
     * @param commodity
     * @param add
     */
    void validCommodity(Commodity commodity, boolean add);

    /**
     * 获取查询条件
     *
     * @param commodityQueryRequest
     * @return
     */
    QueryWrapper<Commodity> getQueryWrapper(CommodityQueryRequest commodityQueryRequest);


    /**
     * 分页获取商品封装
     *
     * @param commodityPage
     * @param request
     * @return
     */
    Page<CommodityVO> getCommodityVOPage(Page<Commodity> commodityPage, HttpServletRequest request);
}
